$(document).ready(function(){            
	$("#sGardeInfo").jqGrid({                
		url:global_url+global_urijs+'schoolgrade_searchSchoolGradeList'+global_suffix+"?sid="+global_sid,                
		datatype:"json",                
		mtype:'GET', 
		height:'300',
		width:'770',
		colNames:['职务名称','职务人数','简述','职务作息','操作','gid'],                
		colModel:[                    
		{name:'name',index:'name',width:80,align:'center'},                    
		{name:'typeNumber',index:'typeNumber',width:60,align:'center'},                    
		{name:'desinfo',index:'desinfo',width:200, sortable:false,align:'center'},
		{name:'date_str',index:'date_str',width:200,align:'center', sortable:false},
		{name:'option',index:'option',width:80,align:'center', sortable:false},
		{name:'gid',index:'gid',hidden:true}    
		],    
		//autowidth:true,
		jsonReader: {
			root:"schoolGradeList",
			page: "page",
			total: "page_count",
			records : "count",
			repeatitems: false
		},
		pager: jQuery("#sGardepage"),
		prmNames : {page:"page",sort: "sort"},
		rowNum: 10,
		//rowList: [10, 20, 30],
		sortname: 'name',
		hidegrid: false,
		sortorder: 'desc',
		viewrecords: true,
		caption: '职务信息',
		gridComplete:function(){
			var ids=jQuery("#sGardeInfo").jqGrid('getDataIDs');
			for(var i=0; i<ids.length; i++){
				var id=ids[i];   
				del = "<a href='javascript:;' class='jqtrow' onclick='delTel(" + id + ")'>删除</a>"; 
				ma = "<a href='javascript:;' class='jqtrow' onclick='upTel(" + id + ")'>修改</a>"; 
				jQuery("#sGardeInfo").jqGrid('setRowData', ids[i], { option: del+" "+ ma });
			}
		}
	}).navGrid("#sGardepage", { edit: false, add: false, del: false, search: false });
});

function delTel(id){
	 $(function() {$( "#compPrompt" ).dialog({
		modal: true,
		resizable: false,
		buttons: {
			"删除": function() {
				var funadd = function(data1){
					if(1==data1.s){
						 $().message("删除成功!");
						 $("#sGardeInfo").trigger("reloadGrid");
						 $("#compPrompt").dialog( "close" );
					}else{
						 $().message("删除失败!");
					}
				};
				exeAjax(ajaxUrl(global_url+global_urijs+'schoolgrade_deleteSchoolGrade'+global_suffix), funadd, {"gid" :jQuery("#sGardeInfo").jqGrid('getRowData', id).gid});
			},"取消": function() {
				$( this ).dialog( "close" );
			}
		}
		});
	});
}











